package visitor;

import com.example.paperselection.PaperSelection;
import com.example.paperselection.Student;

import java.util.HashSet;
import java.util.Set;

public class StudentCountVisitor implements PaperSelectionVisitor {
    private int count;

    @Override
    public void visit(PaperSelection selection) {
        Set<Student> students = new HashSet<>(selection.getSelections().values());
        this.count = students.size();
    }

    @Override
    public Object getResult() {
        return count;
    }
}
